home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Updates⁄New / TEXAS for BMUG / C progs / TEXAS XFCNs ƒ / mergeIndicesXFCN ƒ / mergeIndices.z.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-30  |  2.1 KB  |  79 lines  |  [TEXT/KAHL]

  1. /* headers for the mergeIndices project ... 871203-... ^z
  2.  * revised 871230 for XFCN work ... ^z
  3.  */
  4.  
  5.  
  6. #include <MacTypes.h>
  7. #include <OSUtil.h>
  8. #include <WindowMgr.h>
  9. #include <FileMgr.h>
  10. #include <StdFilePkg.h>
  11. #include <HyperXCmd.h>
  12.  
  13. /* define euphemisms so that array subscripts are human-readable...
  14.  */
  15. #define FIRSTIN     0
  16. #define SECONDIN    1
  17. #define MERGEDOUT   2
  18. #define PTRFILE     0
  19. #define KEYFILE     1
  20. #define TEXTFILE    2
  21.  
  22. #define NULL        0
  23.  
  24. /* define these to allow use of global variables in my XFCN
  25.  */
  26.  
  27. #define SetUpA4()        asm  {    move.l a4,-(sp)        \
  28.                                 move.l a0,a4    }
  29.  
  30. #define RestoreA4()        asm  {    move.l (sp)+,a4    }
  31.  
  32.  
  33.  
  34.  
  35. /* sort on KEY_LENGTH characters ... make it 28 rather arbitrarily as an
  36.  * experiment ... want it long enough to avoid truncation of legitimate
  37.  * words, but short enough to save some space in the *.k files ... an
  38.  * alternative value is 12, for compatibility with the older ndxr.c program
  39.  * and brwsr.c, if they haven't been revised to allow for longer keys....
  40.  */
  41. #define KEY_LENGTH  28
  42.  
  43. /* define a structure for the index_keys file
  44.  */
  45. typedef struct
  46.   {
  47.     char kkey[KEY_LENGTH];
  48.     long ccount;
  49.   }  KEY_REC;
  50.  
  51.  
  52. /* prototypes for my functions ... 
  53.  */
  54.  
  55. pascal void main (XCmdBlockPtr paramPtr);
  56. void give_msg (char *msg);
  57. void beepWait (void);
  58. long atol (char *num);
  59. int init_everything (XCmdBlockPtr paramPtr);
  60. int open_all_files (void);
  61. int merge_key_and_ptr_files (void);
  62. int delete_old_key_and_ptr_files (void);
  63. int merge_text_files (void);
  64. int delete_and_rename_text_files (void);
  65. int getTextFile (int filenum);
  66. int putTextFile (void);
  67. int getFileZ (Str255 *fnp, int *vRefp);
  68. void pStrCopy (char *p1, char *p2);
  69. int CreateFile (Str255 *fn, int *vRef, int *theRef);
  70. KEY_REC *next_input_key (int filenum);
  71. void load_buffer (int filenum, int filetype);
  72. int smaller_key (KEY_REC *kr[]);
  73. char *strncpy (char *p1, char *p2, int len);
  74. int merge_not_done (KEY_REC *kr[]);
  75. int zstrcmp (unsigned char *s1, unsigned char *s2);
  76. void output_key_rec (char *kkey, long ccount);
  77. void output_ptr_recs (int filenum, long num);
  78. long *next_input_ptr (int filenum);
  79. void flush_outbuffer (int filetype);